Comments (6)
$lock = "false";
Have you tried changing this to
$lock = false;
?
from easybitcoin-php.
@erikdubbelboer yep .... I get this instead;
Expected type array, got object
and here is the var_dump of the txid and vout I am using;
Array
(
[txid] => 14acd0774013685a4cda17246298f21101884f6be7198db36fa5e3ee498fab37
[vout] => 1
)
from easybitcoin-php.
Try this:
$tx = $bitcoin->masternode('outputs');
$txid = array_keys($tx);
$tx_array = [];
foreach($txid as $locktx) {
$tx_array[] = [
'txid' => $locktx,
'vout' => (int)$tx[$locktx],
];
}
$lock = "false";
$lock_mn = $bitcoin->lockunspent($lock, $tx_array);
from easybitcoin-php.
some issue @erikdubbelboer ; I get this:
Expected type bool, got string
And my array changed slightly;
Array
(
[0] => Array
(
[txid] => 14acd0774013685a4cda17246298f21101884f6be7198db36fa5e3ee498fab37
[vout] => 1
)
)
from easybitcoin-php.
Solved!!
$tx = $bitcoin->masternode('outputs');
$txid = array_keys($tx);
$tx_array = [];
foreach($txid as $locktx) {
$tx_array[] = [
'txid' => $locktx,
'vout' => (int)$tx[$locktx],
];
}
$lock = false;
$lock_mn = $bitcoin->lockunspent($lock, $tx_array);
I was missing the []
after $tx_array
in my first comment. I last too many hours on a simple mistake
thanks for the help @erikdubbelboer !
from easybitcoin-php.
lockunspent
expects an array of objects, you were only giving it one object because you had your call inside your loop instead of out of it.
from easybitcoin-php.
Related Issues (20)
- Nvm
- Handle much address like 1 million address HOT 1
- Username / Password ? HOT 2
- Windows HOT 1
- Username Password HOT 3
- Possible to not use arrays ? can be closed HOT 5
- Is there a way to specify the wallet file? HOT 1
- named parameter instead of positional HOT 1
- "JSON value is not an integer as expected" HOT 2
- is it php 7 compatible? HOT 1
- why incementing id? HOT 1
- IS "?>"(closing php tag) is Missing in current file? or will this file work without it? HOT 1
- Bitcoind returns error “JSON value is not an array as expected”, using easybitcoin.php to call sendmany() HOT 2
- Empty reply from server HOT 2
- Thank you so much for this Andrew!
- NULL value returned for call HOT 1
- bitcoind won't send bitcoins from wallet HOT 2
- Doesn't work for more complex functions like scantxoutset
- Can not create a new Adress HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easybitcoin-php.