Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Creating New Transaction Object for blockchain

Blockchain.prototype.createNewTransaction = function(amount, sender, recipient) {
    const NewTransaction = {
        amount : amount,
        sender : sender,
        recipient : recipient
    };

    this.pendingTransactions.push(NewTransaction);

    return this.getLastBlock()['index'] +1;
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Creating #New #Transaction #Object #blockchain
ADD COMMENT
Topic
Name
7+1 =