Clone transaction data more efficiently
This commit is contained in:
parent
5d81b94362
commit
f7034350e9
6 changed files with 50 additions and 22 deletions
|
@ -41,6 +41,12 @@ function reverseBuffer(buffer) {
|
|||
return buffer;
|
||||
}
|
||||
exports.reverseBuffer = reverseBuffer;
|
||||
function cloneBuffer(buffer) {
|
||||
const clone = Buffer.alloc(buffer.length);
|
||||
buffer.copy(clone);
|
||||
return buffer;
|
||||
}
|
||||
exports.cloneBuffer = cloneBuffer;
|
||||
/**
|
||||
* Helper class for serialization of bitcoin data types into a pre-allocated buffer.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue